//
//  SetTradingPassWordSuccessViewController.m
//  NewPro
//
//  Created by RYX on 2019/4/22.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "SetTradingPassWordSuccessViewController.h"
#import "SettingViewController.h"
#import "FanXianViewController.h"
#import "IncomeViewController.h"
#import "OrdertoSureVC.h"

@interface SetTradingPassWordSuccessViewController ()

@end

@implementation SetTradingPassWordSuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNavBarWithTitle:@"设置交易密码"];
    
}

- (void)back{
    
    UINavigationController *nav = self.navigationController;
    
    NSMutableArray *viewControllers = [[NSMutableArray alloc]init];
    
    for (UIViewController *vc in [nav viewControllers]) {
        
        [viewControllers addObject:vc];
        
        if ([self.wherefrom isEqualToString:@"IncomeViewController"]) {
            
            if ([vc isKindOfClass:[IncomeViewController class]] ) {
                
                break;
            }
        }else if ([self.wherefrom isEqualToString:@"FanXianViewController"]) {
            
            if ([vc isKindOfClass:[FanXianViewController class]]) {
                
                break;
            }
        }else if ([self.wherefrom isEqualToString:@"OrdertoSureVC"]) {
            
            if ( [vc isKindOfClass:[OrdertoSureVC class]]) {
                
                break;
            }
        }else{
            
            if ([vc isKindOfClass:[SettingViewController class]] || [vc isKindOfClass:[FanXianViewController class]] || [vc isKindOfClass:[IncomeViewController class]] || [vc isKindOfClass:[OrdertoSureVC class]]) {
                
                break;
            }
        }
        
    }
    
    [nav setViewControllers:viewControllers animated:YES];
}

- (IBAction)onSureBtn:(UIButton *)sender {
    
    [self back];
}

@end
